#ifndef __BASIC_TYPES_H__
#define __BASIC_TYPES_H__
#include "Eigen/Geometry"
#include "lidar_detect/lidar_objects.h"
#include <vector>

typedef struct {
    double euler_angle_yaw;
    double euler_angle_pitch;
    double euler_angle_roll;    
    double pose_position_x;
    double pose_position_y;
    double pose_position_z;
    Eigen::Quaternionf euler_quaternion;
    Eigen::Affine3d transformation;
   EIGEN_MAKE_ALIGNED_OPERATOR_NEW  
}ExtrinsicsDef;

typedef struct {
  float x;            /**< X axis, Unit:m */
  float y;            /**< Y axis, Unit:m */
  float z;            /**< Z axis, Unit:m */
  float reflectivity; /**< Reflectivity   */
  uint8_t tag;        /**< Livox point tag   */
  uint8_t line;       /**< Laser line id     */
  double timestamp;   /**< Timestamp of point*/
} LivoxPointXyzrtlt;


typedef struct {
    int type;
    std::string serial_num;
    std::string desc;
    ExtrinsicsDef param;
}SensorCalibrationParameterDef;

typedef struct{
    float x;
    float y;
} KeyPointDef;

typedef struct{
    int16_t    id;
    int8_t     type;
    float      x;
    float      y;
    float      length_x;
    float      length_y;
    float      speed_x;
    float      speed_y;
    int16_t    point_count;
    std::vector<KeyPointDef> obj_points;

} Lidar3DObjectDef;

typedef struct{
   public:
   int64_t    utime;
   int16_t    object_count;
   std::vector<Lidar3DObjectDef> lidar_3d_object;
} Lidar3DInfoDef;


class RawDataPoint
{
public:
    double verAngle, horAngle, distance, intensity;
    double x, y, z; 
};

struct gridObjPoint                                                                                                                                                 
{
public:
    int lowwer_ob;
    int upper_ob;

    float upper_yMax;
    float upper_xMax;
    float upper_yMin;
    float upper_xMin;
    float upper_zMin;
    float upper_zMax;

    float lowwer_yMax;
    float lowwer_xMax;
    float lowwer_yMin;
    float lowwer_xMin;
    float lowwer_zMin;
    float lowwer_zMax;
    float lowwer_zAverage;
    std::vector<lidar_detect::raw_data_point> UpperCloudPoints;
    std::vector<lidar_detect::raw_data_point> LowwerCloudPoints;
};


class key_point_t
{                                                                                                                    
    public:
        float   x;   
        float   y;
};

struct LiDAROb
{
    int id;
    bool StaticOb;
    float CentralX;                                                                                                  
    float CentralY;
    float CentralZ;
    float ObLength;
    float ObWidth;
    float ObHeight;
    lidar_detect::keypoint left_limit_position;
    lidar_detect::keypoint front_limit_position;
    lidar_detect::keypoint rear_limit_position;
    lidar_detect::keypoint right_limit_position; 
    float speed_1;
    float speed_2;
    float speed_3;
    float distance_1;
    std::vector<lidar_detect::raw_data_point> CloudPoints;
    std::vector<lidar_detect::keypoint> ContourPointsVector;
};


#endif /* __BASIC_TYPES_H__ */
